<?php

class MHoaDon extends CI_Model
{
	function danhsachhoadonsanpham()
	{		
		return $this->db->get('hoadonsp')->result();
	}
	
	function danhsachsanphamlimit($madm, $sodong, $dongbatdau)
	{
		$this->db->where('madm', $madm);
		$this->db->where('hienthi', 'true');		
		return $this->db->get('sanpham',$sodong, $dongbatdau)->result();
	}
	
	function danhsachAdmin()
	{
		return $this->db->get('sanpham')->result();
	}
	
	function xoahd($mahd)
	{
		$this->db->where('mahd', $mahd);
		$this->db->delete('hoadonsp');
	}
		
	function thongtinhoadon($mahd)
	{
		$this->db->where('mahd', $mahd);
		return $this->db->get('hoadonsp')->row();
	}
			
}

?>